package 字节;


import java.util.*;

public class Main_0918_4 {
    static class MAXQueue{
        LinkedList<Integer> queue =new LinkedList<>();
        public void push(int n){
            while (!queue.isEmpty()&& queue.getLast()<n){
                queue.pollLast();
            }
            queue.addLast(n);
        }
        public int getmax(){
            return  queue.getFirst();
        }
        public void pop(int n){
            if(n==queue.getFirst()){
                queue.pollFirst();
            }
        }
    }
    static class MINQueue{
        LinkedList<Integer> queue =new LinkedList<>();
        public void push(int n){
            while (!queue.isEmpty()&& queue.getLast()>n){
                queue.pollLast();
            }
            queue.addLast(n);
        }
        public int getmin(){
            return  queue.getFirst();
        }
        public void pop(int n){
            if(n==queue.getFirst()){
                queue.pollFirst();
            }
        }
    }
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        //n书籍数量，k不能超过k的差
        int n=cin.nextInt(),k=cin.nextInt();
        int[] height=new int[n+1];
        for (int i = 1; i <= n; i++) {
            height[i]=cin.nextInt();
        }
        //滑动窗口，并记录滑动窗口内的最大值和最小值，计算最大和最小值的差
        MAXQueue maxQueue=new MAXQueue();
        MINQueue minQueue=new MINQueue();
        int resLen=1;
        //记录各种长度的满足要求的结果
        Map<Integer,List<int[]>> res=new HashMap<>();
        int left=1,right=1;
        while (right<=n){
            int hcur=height[right];
            right++;
            maxQueue.push(hcur);
            minQueue.push(hcur);
            int max=maxQueue.getmax();
            int min=minQueue.getmin();
            if (max-min<=k){
                int len=right-left;
                resLen=Math.max(resLen,len);
                List<int[]> list = res.getOrDefault(len, new LinkedList<>());
                list.add(new int[]{left,right-1});
                res.put(len,list);
            }else {
                while (left<right&&maxQueue.getmax()-minQueue.getmin()>k){
                    int d=height[left];
                    left++;
                    minQueue.pop(d);
                    maxQueue.pop(d);
                }
                if (maxQueue.getmax()-minQueue.getmin()<=k){
                    int len=right-left;
                    resLen=Math.max(resLen,len);
                    List<int[]> list = res.getOrDefault(len, new LinkedList<>());
                    list.add(new int[]{left,right-1});
                    res.put(len,list);
                }
            }
        }
        int resCount=res.get(resLen).size();
        System.out.println(resLen+" "+resCount);
        for (int[] r:res.get(resLen)) {
            System.out.println(r[0]+" "+r[1]);
        }
    }
}
